package com.iwe3.protal.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class BookEntity {
    //JSON转换为：String
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    private Integer typeId;
    private String name;
    private String provider;
    private String author;
    private BigDecimal price;
    private String detail;
    private String imgsrc;
    private Integer collectioncount;
    private Integer storecount;
    private Integer buycount;
    private Integer readcount;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private LocalDateTime createtime;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private LocalDateTime updatetime;
    private Integer state;
    private Integer version;
}
